package com.haidechizi.i18n.code.generator.common.message.translate;

import com.haidechizi.i18n.code.generator.common.message.config.GeneratorProperties;
import com.haidechizi.i18n.code.generator.common.message.constants.TranslateTypeConstants;
import com.haidechizi.i18n.code.generator.common.message.translate.yeecloudmt.YeeCloudMtUtils;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author wangdejun
 * @create 2020/10/30 15:40
 */
public class YeeCloudMtTranslate extends AbstractTranslate {

    @Autowired
    private GeneratorProperties generatorProperties;

    /**
     * 类型
     *
     * @return
     */
    @Override
    public String type() {
        return TranslateTypeConstants.YeeCloudMt;
    }

    /**
     * 翻译顶层接口
     * <p>
     * currentLanguage->language
     *
     * @param data
     * @param currentLanguage
     * @param language
     * @return
     */
    @Override
    public String translate(String data, String currentLanguage, String language) {
        return YeeCloudMtUtils.translate(data, currentLanguage, language, generatorProperties.getYeeCloudMtAppCode());
    }
}
